<%@page contentType="text/html;charset=utf-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>   

<%@page import="com.manage.model.SpCode"%><script type="text/javascript">
function manage_sp_savecode(type)
{
    var name = document.getElementById("model.codeName").value;
    var carrier = document.getElementById("model.carrier").value;
    var orderType = document.getElementById("model.orderType").value;
    if (name == null || name == ""
        || carrier == null || carrier == ""
        || orderType == null || orderType == "")
    {
        alert("信息不完整！");
        return false;
    }
	
	if(!$("input[name=model.openProvince]:checked").length){
		alert("请勾选开通省份！！");
		return false;
	}
    if (!confirm("确定继续？"))
    {
        return false;
    }
    var url = "mg/code/save.do?type=" + type;
    var objectid = "manage_sp_showcodediv";
    postXMLHttpRequest(url, "myform", objectid); 
}

function manager_sp_checkcodeprovince(obj)
{
	if (obj.checked == true)
	{   
		var caption = document.getElementById("open_province_caption");
		if (caption.style.display == "none")
			caption.style.display = "";
		document.getElementById("open_province_" + obj.value).style.display = "";
		document.getElementById("shield_region_" + obj.value).style.display = "";
		
		document.getElementById("open_province_"+obj.value+"_daily_limit").value = document.getElementById("model.codedailylimit").value;
		document.getElementById("open_province_"+obj.value+"_fee_value").value= document.getElementById("model.codefeevalue").value;
		document.getElementById("open_province_"+obj.value+"_monthly_limit").value= document.getElementById("model.codemonthlylimit").value;

		document.getElementById("open_province_"+obj.value+"_pbalancetype").value= document.getElementById("model.balancetype").value;		
		document.getElementById("open_province_"+obj.value+"_pbalancevalue").value= document.getElementById("model.balancevalue").value;
		document.getElementById("open_province_"+obj.value+"_pbalancecyc").value= document.getElementById("model.balancecyc").value;			
	}
	else
	{
		document.getElementById("open_province_" + obj.value).style.display = "none";
		document.getElementById("shield_region_" + obj.value).style.display = "none";
		
		var b = false;
		var ckbs = document.getElementsByName("model.openProvince");
		for (var n = 0; n < ckbs.length; n++)
		{
			if (ckbs[n].checked == true)
			{
				b = true;
				break;
			}
		}
		if (b == false)
			document.getElementById("open_province_caption").style.display = "none";
	}
}
function manage_sp_checkallprovince(obj)
{
	var ckbs = document.getElementsByName("model.openProvince");
	if (obj.checked == true)
	{
		var caption = document.getElementById("open_province_caption");
		if (caption.style.display == "none")
			caption.style.display = "";
		for (var n = 0; n < ckbs.length; n++)
		{
			ckbs[n].checked = true;
			document.getElementById("open_province_" + ckbs[n].value).style.display = "";
			document.getElementById("shield_region_" + ckbs[n].value).style.display = "";

			document.getElementById("open_province_"+ckbs[n].value+"_daily_limit").value = document.getElementById("model.codedailylimit").value;
			document.getElementById("open_province_"+ckbs[n].value+"_fee_value").value= document.getElementById("model.codefeevalue").value;
			document.getElementById("open_province_"+ckbs[n].value+"_monthly_limit").value= document.getElementById("model.codemonthlylimit").value;	

			document.getElementById("open_province_"+ckbs[n].value+"_pbalancetype").value = document.getElementById("model.balancetype").value;
			document.getElementById("open_province_"+ckbs[n].value+"_pbalancevalue").value= document.getElementById("model.balancevalue").value;
			document.getElementById("open_province_"+ckbs[n].value+"_pbalancecyc").value= document.getElementById("model.balancecyc").value;	
		}
	}
	else
	{
		document.getElementById("open_province_caption").style.display = "none";
		for (var n = 0; n < ckbs.length; n++)
		{
			ckbs[n].checked = false;
			document.getElementById("open_province_" + ckbs[n].value).style.display = "none";
			document.getElementById("shield_region_" + ckbs[n].value).style.display = "none";
		}
	}
}
function showregion(province,regions)
{
	regions = document.getElementById("open_province_"+province+"_shield_region").value;
	window.open ('mg/code/regionshow.do?province='+province+'&regions='+regions,'newwindow','height=300,width=500,top=100,left=300,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')

}
function saveshowregion(province,regions,regionnames)
{
	document.getElementById("open_province_"+province+"_shield_region").value=regions;
	document.getElementById("open_province_"+province+"_shield_regionname").value=regionnames;
}
</script>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5"></td>
    <td>   
  <form id="myform" name="myform" method="post" action="">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/table_top_left.jpg" width="20" height="15" /></td>
            <td><img src="images/table_top_bg.jpg" width="770" height="15"/></td>
            <td align="right">
              <img src="images/table_top_right.jpg" width="20" height="15" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="3" class="table_blue">
        <strong><img src="images/dot.jpg" width="13" height="9">代码信息</strong>   
        <input id="model.id" name="model.id" type="hidden" value="<s:property value="model.id" />"/>
        
        <input id="model.createUser" name="model.createUser" type="hidden" value="<s:property value="model.createUser" />"/>
        <input id="model.createDate" name="model.createDate" type="hidden" value="<s:property value="model.createDate" />"/>
        <input id="model.spId" name="model.spId" type="hidden" value="<s:property value="spId" />"/>  
        <input id="spId" name="spId" type="hidden" value="<s:property value="spId" />"/>  
        <input id="codeType" name="codeType" type="hidden" value="<s:property value="codeType" />"/>     
        </td>        
    </tr> 
    <tr>
      <td class="table_w1">&nbsp;<font color="red">(*)</font>名称：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="model.codeName" name="model.codeName" type="text" size="60"
          value="<s:property value="model.codeName" />"/></td>
    </tr>
    <tr>
      <td class="table_w1">&nbsp;<font color="red">(*)</font>运营商：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <select id="model.carrier" name="model.carrier" style="width:280px;">
           <option value="">请选择</option>
           <s:iterator value="%{getConstant('carrier')}">
           <option value="<s:property value="key" />" <s:if test="model.carrier.equals(key)">selected</s:if> ><s:property value="value" /></option>
           </s:iterator>
        </select>
    </tr>
    <tr>
      <td class="table_w1">&nbsp;<font color="red">(*)</font>业务线：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <select id="model.codeType1" name="model.codeType1" style="width:280px;" disabled="disabled">
           <option value="">请选择</option> 
           <s:iterator value="%{getConstant('code type')}">
           <option value="<s:property value="key" />" <s:if test="model.codeType.equals(key)">selected</s:if> ><s:property value="value" /></option>
           </s:iterator>
        </select>
         <input id="model.codeType" name="model.codeType" type="hidden" value="<s:property value="model.codeType" />"/>
    </tr>
    <tr>
      <td class="table_w1">&nbsp;<font color="red">(*)</font>订购方式：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <select id="model.orderType" name="model.orderType" style="width:280px;">
        <option value="">请选择</option> 
           <s:iterator value="%{getConstant('order type')}">
           <option value="<s:property value="key" />" <s:if test="model.orderType.equals(key)">selected</s:if> ><s:property value="value" /></option>
           </s:iterator>
        </select>
    </tr>
    <s:if test='codeType.equals("1")||codeType.equals("2")'>
	    <tr>
	      <td class="table_w1">&nbsp;<font color="red">(*)</font>端口：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.smspayport" name="model.smspayport" type="text" size="60" 
	          value="<s:property value="model.smspayport" />"/></td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;指令：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.smspaycode" name="model.smspaycode" type="text" size="60" 
	          value="<s:property value="model.smspaycode" />"/></td>
	    </tr>
    </s:if>
    <s:elseif test='codeType.equals("13")'>
    	<tr>
	      <td class="table_w1">&nbsp;计费参数：</td>
	      <td class="table_w2" colspan="2">
		      <table id="baseparameterTab" width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="100px" align="right" class="table_w2">pid：</td>
					<td class="table_w2">&nbsp;<input id="tmp_pid" name="tmp_pid" value='<s:property value="parameterMap['pid']" />' size="46px" /><font color="red">&nbsp;&nbsp;合作ID</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">contentId：</td>
					<td class="table_w2">&nbsp;<input id="tmp_contentId" name="tmp_contentId" value='<s:property value="parameterMap['contentId']" />' size="46px" /><font color="red">&nbsp;&nbsp;中移动合作方ID</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">channelId：</td>
					<td class="table_w2">&nbsp;<input id="tmp_channelId" name="tmp_channelId" value='<s:property value="parameterMap['channelId']" />' size="46px" /><font color="red">&nbsp;&nbsp;中移动8位渠道代码</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">cpId：</td>
					<td class="table_w2">&nbsp;<input id="tmp_cpId" name="tmp_cpId" value='<s:property value="parameterMap['cpId']" />' size="46px" /><font color="red">&nbsp;&nbsp;中移动提供的cpId</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">loginParam：</td>
					<td class="table_w2">&nbsp;<input id="tmp_loginParam" name="tmp_loginParam" value='<s:property value="parameterMap['loginParam']" />' size="46px" /><font color="red">&nbsp;&nbsp;合作方向中移动提供的登录透传参数</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">cmSDKVer：</td>
					<td class="table_w2">&nbsp;<input id="tmp_cmSDKVer" name="tmp_cmSDKVer" value='<s:property value="parameterMap['cmSDKVer']" />' size="46px" /><font color="red">&nbsp;&nbsp;中移动SDK版本号(如21014)</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">chargeId：</td>
					<td class="table_w2">&nbsp;<input id="tmp_chargeId" name="tmp_chargeId" value='<s:property value="parameterMap['chargeId']" />' size="46px" /><font color="red">&nbsp;&nbsp;中移动提供的道具下标</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">chargeParam：</td>
					<td class="table_w2">&nbsp;<input id="tmp_chargeParam" name="tmp_chargeParam" value='<s:property value="parameterMap['chargeParam']" />' size="46px" /><font color="red">&nbsp;&nbsp;合作方提供给中移动的透传参数,必须(16位)</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">game_name：</td>
					<td class="table_w2">&nbsp;<input id="tmp_game_name" name="tmp_game_name" value='<s:property value="parameterMap['game_name']" />' size="46px" /><font color="red">&nbsp;&nbsp;游戏名称</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">charge_name：</td>
					<td class="table_w2">&nbsp;<input id="tmp_charge_name" name="tmp_charge_name" value='<s:property value="parameterMap['charge_name']" />' size="46px" /><font color="red">&nbsp;&nbsp;道具名称</font></td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">isOnline：</td>
					<td class="table_w2">&nbsp;<input id="tmp_isOnline_0" name="tmp_isOnline" type="radio" <s:if test="parameterMap['isOnline'].length()==0||parameterMap['isOnline'].equals('true')">checked</s:if> value='true' />网游&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="tmp_isOnline" id="tmp_isOnline_1" <s:if test="parameterMap['isOnline'].equals('false')">checked</s:if>  value="false" />单机</td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">type：</td>
					<td class="table_w2">&nbsp;<input id="tmp_type_0" name="tmp_type" type="radio" <s:if test="parameterMap['type'].length()==0||parameterMap['type'].equals('sdk')">checked</s:if> value='sdk' />SDK&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="tmp_type" id="tmp_type_1" <s:if test="parameterMap['type'].equals('http')">checked</s:if>  value="http" />HTTP</td>
				</tr>
				<tr>
					<td width="100px" align="right" class="table_w2">pay_type：</td>
					<td class="table_w2">&nbsp;<input id="tmp_pay_type_0" name="tmp_pay_type" type="radio" <s:if test="parameterMap['pay_type'].equals('mm')">checked</s:if> value='mm' />MM&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="tmp_pay_type" id="tmp_pay_type_1" <s:if test="parameterMap['pay_type'].length()==0||parameterMap['pay_type'].equals('cmgc')">checked</s:if>  value="cmgc" />游戏基地<font color="red">&nbsp;&nbsp;&nbsp;充值类型</font></td>
				</tr>
		      </table>
	      </td>
	    </tr>
    </s:elseif>
    <s:else>
    	 <tr>
	      <td class="table_w1">&nbsp;基地动作：</td>
	      <td class="table_w2" colspan="2">&nbsp;
         <textarea id="model.basepayaction" name="model.basepayaction" rows="3" cols="60"><s:property value='model.basepayaction' escape="false"/></textarea></td>
	    </tr>
	     <tr>
	      <td class="table_w1">&nbsp;模拟UA：</td>
	      <td class="table_w2" colspan="2">&nbsp;
         <textarea id="model.codeua" name="model.codeua" rows="2" cols="60"><s:property value='model.codeua' escape="false"/></textarea>
         <font color="red">&nbsp;&nbsp;多个模拟UA用^^^隔开</font>
         </td>
	    </tr>
    </s:else>
    <tr>
	      <td class="table_w1">&nbsp;<font color="red">(*)</font>资费：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.codefeevalue" name="model.codefeevalue" type="text" size="60" 
	          value="<s:property value="model.codefeevalue" />"/><font color="red">&nbsp;&nbsp;单位：分</font></td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;<font color="red">(*)</font>日限：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.codedailylimit" name="model.codedailylimit" type="text" size="60" 
	          value="<s:property value="model.codedailylimit" />"/><font color="red">&nbsp;&nbsp;单位：分</font></td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;<font color="red">(*)</font>月限：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.codemonthlylimit" name="model.codemonthlylimit" type="text" size="60" 
	          value="<s:property value="model.codemonthlylimit" />"/><font color="red">&nbsp;&nbsp;单位：分</font></td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;<font color="red">(*)</font>日承载量：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.codedailycapacity" name="model.codedailycapacity" type="text" size="60" 
	          value="<s:property value="model.codedailycapacity" />"/><font color="red">&nbsp;&nbsp;单位：分</font></td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;<font color="red">(*)</font>月承载量：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.codemonthlycapacity" name="model.codemonthlycapacity" type="text" size="60" 
	          value="<s:property value="model.codemonthlycapacity" />"/><font color="red">&nbsp;&nbsp;单位：分</font></td>
	    </tr>
	    <tr>
          <td class="table_w1">&nbsp;<font color="red">(*)</font>有效期：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input type="text" id="startdate1" dojoType="dijit.form.DateTextBox" name="startdate1" style="width:85px;" 
	            value="<s:property value="startdate1" />" constraints="{datePattern:'yyyy-MM-dd'}" />
			<input type="text" id="startdate2" dojoType="dijit.form.TimeTextBox" name="startdate2" style="width:85px;"
                value="<s:property value="startdate2" />" constraints="{timePattern:'HH:mm:ss'}" />
            &nbsp;----&nbsp;
            <input type="text" id="expireddate1" dojoType="dijit.form.DateTextBox" name="expireddate1" style="width:85px;"
                value="<s:property value="expireddate1"/>" constraints="{datePattern:'yyyy-MM-dd'}" />
			<input type="text" id="expireddate2" dojoType="dijit.form.TimeTextBox" name="expireddate2" style="width:85px;"
                value="<s:property value="expireddate2" />" constraints="{timePattern:'HH:mm:ss'}" /> </td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;<font color="red">(*)</font>订购间隔：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.space" name="model.space" type="text" size="60" 
	          value="<s:property value="model.space" />"/><font color="red">&nbsp;&nbsp;单位：小时</font></td>
	    </tr>
     <tr>
	      <td class="table_w1">&nbsp;优先级：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.level" name="model.level" type="text" size="60" 
	          value="<s:property value="model.level" />"/><font color="red">&nbsp;&nbsp;数字越大优先级越高</font></td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;结算方式：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	       <select id="model.balancetype" name="model.balancetype"  style="width:280px;">
		           <s:iterator value="%{getConstant('settlement_method')}">
		           <option value="<s:property value="key" />" <s:if test="model.balancetype.equals(key)">selected</s:if> ><s:property value="value" /></option>
		           </s:iterator>
		        </select>
	     </td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;结算值：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	        <input id="model.balancevalue" name="model.balancevalue" type="text" size="60" 
	          value="<s:property value="model.balancevalue" />"/></td>
	    </tr>
	    <tr>
	      <td class="table_w1">&nbsp;结算周期：</td>
	      <td class="table_w2" colspan="2">&nbsp;
	      	<select id="model.balancecyc" name="model.balancecyc"  style="width:280px;">
		           <s:iterator value="%{getConstant('settlement_interval')}">
		           <option value="<s:property value="key" />" <s:if test="model.balancecyc.equals(key)">selected</s:if> ><s:property value="value" /></option>
		           </s:iterator>
		        </select>
	        </td>
	    </tr>
    <tr>
      <td class="table_w1">&nbsp;<font color="red">(*)</font>开通省份：<input type="checkbox" onclick="manage_sp_checkallprovince(this);" /></td>
      <td class="table_w2" colspan="2">
        <div >
        <table width="100%" border="0" cellspacing="0" cellpadding="0" >
        <tr style="visibility: true">
        <s:iterator value="%{getProvinces()}" status="stat">
        <s:if test="#stat.index>0&&#stat.index%8==0"></tr><tr></s:if>
        <!-- s:if test="!provinceCode.equals('UNKN')"> -->
        <td width="10%" class="table_w2" align="left">&nbsp;&nbsp;<input type="checkbox" onclick="manager_sp_checkcodeprovince(this);" 
        <s:if test="(','+model.openProvince+',').indexOf(','+code+',')!=-1">checked</s:if> 
        name="model.openProvince" id="model.openProvince" value="<s:property value="code" />">&nbsp;<s:property value="name" /></td>
        <!-- /s:if --></s:iterator>
        </tr>
        </table></div>
        <div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" >
        <tr id="open_province_caption" style="display:<s:if test="model.openProvince.length()>1"></s:if><s:else>none</s:else>" >
        <td class="table_g2" width="10%" align="center" >省份</td>
        <td class="table_g2" width="10%" align="center" >资费</td>
        <td class="table_g2" width="10%" align="center" >日限</td>
        <td class="table_g2" width="10%" align="center" >月限</td>
        <td class="table_g2" width="10%" align="center" >日承载量</td>
        <td class="table_g2" width="10%" align="center" >月承载量</td>
        <td class="table_g2" width="10%" align="center" >结算方式</td>
        <td class="table_g2" width="10%" align="center" >结算值</td>
        <td class="table_g2" width="10%" align="center" >月结算周期</td>
        </tr>
        <s:iterator value="%{getProvinces()}" status="stat">
        <tr id="open_province_<s:property value="code" />" 
        style="display:<s:if test="(','+model.openProvince+',').indexOf(','+code+',')!=-1"></s:if><s:else>none</s:else>">
        <s:set name="codeProvince" value="%{getSpCodeProvince(model, code, plist)}" />
        <td class="table_w2" align="center" rowspan="2"><s:property value="name" />
        <input type="hidden" id="open_province_<s:property value="code" />_code_province_id" name="open_province_<s:property value="code" />_code_province_id" value="<s:property value="#codeProvince.provinceCode" />" ></td>
        <td class="table_w2" align="center">
        <input type="text" size="3" value="<s:property value="#codeProvince.feeValue" />" id="open_province_<s:property value="code" />_fee_value" name="open_province_<s:property value="code" />_fee_value"/></td>
        <td class="table_w2" align="center"><input type="text" size="3" value="<s:property value="#codeProvince.dailyLimit" />" id="open_province_<s:property value="code" />_daily_limit" name="open_province_<s:property value="code" />_daily_limit"/></td>
        <td class="table_w2" align="center"><input type="text" size="3" value="<s:property value="#codeProvince.monthlyLimit" />" id="open_province_<s:property value="code" />_monthly_limit" name="open_province_<s:property value="code" />_monthly_limit"/></td>
        <td class="table_w2" align="center"><input type="text" size="5" value="<s:property value="#codeProvince.dailyCapacity" />" id="open_province_<s:property value="code" />_daily_capacity" name="open_province_<s:property value="code" />_daily_capacity"/></td>        
        <td class="table_w2" align="center"><input type="text" size="5" value="<s:property value="#codeProvince.monthlyCapacity" />" id="open_province_<s:property value="code" />_monthly_capacity" name="open_province_<s:property value="code" />_monthly_capacity"/></td>
        <td class="table_w2" align="center">
        	<select id="open_province_<s:property value="code" />_pbalancetype" name="open_province_<s:property value="code" />_pbalancetype">
		           <s:iterator value="%{getConstant('settlement_method')}">
		           <option value="<s:property value="key" />" <s:if test="#codeProvince.pbalancetype.equals(key)">selected</s:if> ><s:property value="value" /></option>
		           </s:iterator>
		        </select>
        </td>
        <td class="table_w2" align="center"><input type="text" size="5" value="<s:property value="#codeProvince.pbalancevalue" />" id="open_province_<s:property value="code" />_pbalancevalue" name="open_province_<s:property value="code" />_pbalancevalue"/></td>
        <td class="table_w2" align="center">
        <select id="open_province_<s:property value="code" />_pbalancecyc" name="open_province_<s:property value="code" />_pbalancecyc" >
		           <s:iterator value="%{getConstant('settlement_interval')}">
		           <option value="<s:property value="key" />" <s:if test="#codeProvince.pbalancecyc.equals(key)">selected</s:if> ><s:property value="value" /></option>
		           </s:iterator>
		        </select>
        </td>
        </tr>
        <tr  id="shield_region_<s:property value="code" />" style="display:<s:if test="(','+model.openProvince+',').indexOf(','+code+',')!=-1"></s:if><s:else>none</s:else>">
        <td class="table_w2" colspan="8">&nbsp;屏蔽地区：&nbsp;&nbsp;
        <input readonly="readonly" onclick="showregion('<s:property value="code" />','<s:property value="#codeProvince.shieldRegion" />')" type="text" size="60" value="<s:property value="%{regionToNameString(code,#codeProvince.shieldRegion)}"/>" id="open_province_<s:property value="code" />_shield_regionname" name="open_province_<s:property value="code" />_shield_regionname" />
        <input onclick="showregion('<s:property value="code" />','<s:property value="#codeProvince.shieldRegion" />')" type="hidden" size="60" value="<s:property value="#codeProvince.shieldRegion" />" id="open_province_<s:property value="code" />_shield_region" name="open_province_<s:property value="code" />_shield_region" /></td>
        </tr>
        </s:iterator>
        </table></div>
      </td>
    </tr>
    <tr>
      <td class="table_w1">&nbsp;说明：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <textarea id="model.codeDesc" name="model.codeDesc" rows="3" cols="60"><s:property value="model.codeDesc" /></textarea>
    </tr>
    <tr>
      <td class="table_w1">&nbsp;<font color="red">(*)</font>状态：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <select id="model.codeStatus" name="model.codeStatus" dojoType="dijit.form.FilteringSelect" style="width:280px;" <s:if test="type.equals('insert')">readonly="readonly"</s:if>>
        <option value="">请选择</option> 
           <s:iterator value="%{getConstant('code status')}">
           <option value="<s:property value="key" />" <s:if test="model.codeStatus.equals(key)">selected</s:if> ><s:property value="value" /></option>
           </s:iterator>
        </select>
    </tr>
    <tr>
      <td colspan="3" class="table_w1" align="center">
        <s:if test="type.equals('insert')">
        <button id="btn3" dojoType="dijit.form.Button"
            onclick="return manage_sp_savecode('insert');">添加</button>
        </s:if>
        <s:else>
        <button id="btn3" dojoType="dijit.form.Button"
            onclick="return manage_sp_savecode('update');">修改</button>
        &nbsp;&nbsp;        
        </s:else>
      </td>      
    </tr>
    <tr> 
      <td colspan="3" background="images/table_bom_bg.jpg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/table_bom_left.jpg" width="20" height="15"></td>
          <td></td>
          <td align="right">
            <img src="images/table_bom_right.jpg" width="20" height="15"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>  
  </form>
  </td>
  <td width="5"></td>
  </tr>
  </table>
  <div id="manage_sp_codelog"></div>